﻿using System.Reflection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Marbles.Core.Helpers
{
    public static class System
    {
        public static string GetVersion()
        {
            Assembly assm = Assembly.GetExecutingAssembly();
            AssemblyName assmName = assm.GetName();
            AssemblyDescriptionAttribute descAttr = (AssemblyDescriptionAttribute)AssemblyDescriptionAttribute.GetCustomAttribute(assm, typeof(AssemblyDescriptionAttribute));
            return descAttr.Description + " " + assmName.Version.ToString();
        }

        public static string GetFullVersion()
        {
            Assembly assm = Assembly.GetExecutingAssembly();
            AssemblyName assmName = assm.GetName();
            AssemblyDescriptionAttribute descAttr = (AssemblyDescriptionAttribute)AssemblyDescriptionAttribute.GetCustomAttribute(assm, typeof(AssemblyDescriptionAttribute));            
            AssemblyTitleAttribute title = (AssemblyTitleAttribute)AssemblyTitleAttribute.GetCustomAttribute(assm, typeof(AssemblyTitleAttribute));
            AssemblyCopyrightAttribute cpy = (AssemblyCopyrightAttribute)AssemblyCopyrightAttribute.GetCustomAttribute(assm, typeof(AssemblyCopyrightAttribute));
            return descAttr.Description + " " + assmName.Version.ToString() + "  " + cpy.Copyright;


        }

        public static string GetPlatform()
        {
            return Environment.OSVersion.ToString();
        }
    }
}
